package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.BusinessMapper;
import com.foreknow.elmboot.po.Business;
import com.foreknow.elmboot.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by foreknow on 2023/6/05.
 * @Service注解表示当前的业务层交给Spring来管理，这样就可以提供对事务的支持
 * @Autowired 自动装配 ，也可以理解为依赖注入
 * 表示在前当的Service实现类中要注入BusinessMapper（dao）层的接口，接口的初始化交给Spring的IOC容器来管理
 * 之后就可以直接调用mapper层的方法了。
 */
@Service
public class BusinessServiceImpl implements BusinessService {
    @Autowired
    private BusinessMapper businessMapper;

    @Override
    public List<Business> listBusinessByTypeId(Integer orderTypeId) {
        return businessMapper.listBusinessByOrderTypeId(orderTypeId);
    }

    @Override
    public Business getBusinessById(Integer businessId) {
        return businessMapper.getBusinessById(businessId);
    }
}
